<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:rich="http://richfaces.org/rich">
    <h:head>
        <title><h:outputText value="#{msgs.ged}"/></title>
        <link type="text/css" rel="stylesheet" href="css/style.css" media="all"/>
    </h:head>
    
    <h:body>
        <div class="container">
            <div class="conteudo">
                <div class="cabecalho">
                    <h:outputText value="#{msgs.ged}"/>
                </div><!-- Fim do cabecalho -->

                <h:form styleClass="principal">
                    <h:messages layout="table" showSummary="true" showDetail="false" globalOnly="true"
                        styleClass="msgErro" infoClass="msgInfo" style="text-align: center; width: 100%;"/>
                    
                    <h:panelGrid columns="1" styleClass="formulario">
                        <div>
                            <h:outputText value="#{msgs.usuario}" />
                            <h:selectOneMenu id="usuario" value="#{ctrDocumento.documento.usuario}" required="true">
                                <f:converter converterId="converter.ConverterUsuario" />
                                <f:selectItems value="#{ctrUsuario.usuarios}" var="usuario" itemLabel="#{usuario.nome}" itemValue="#{usuario.id}"/>
                            </h:selectOneMenu>
                        </div>
                        
                        <div style="margin-top: 10px;">
                            <h:outputText value="#{msgs.documento}" />
                            <h:outputText value="#{ctrDocumento.documento.nome}" />
                            <rich:fileUpload fileUploadListener="#{ctrDocumento.upload}" maxFilesQuantity="1" 
                                id="upload" acceptedTypes="jpg, gif, png, txt, doc, docx, pdf">
                            </rich:fileUpload>
                        </div>
                        
                        <h:panelGroup style="margin-top: 10px;">
                            <h:commandButton value="#{msgs.alterar}" action="#{ctrDocumento.alterar}"/>
                            
                            <h:commandButton value="#{msgs.voltar}" action="voltar"/>
                        </h:panelGroup>
                    </h:panelGrid>
                </h:form>
            </div><!-- Fim do conteudo -->
        </div><!-- Fim do container -->
        
         <div class="rodape">
            <div class="info">Desenvolvido por Jefferson Cardoso</div>
        </div>
    </h:body>
</html>